import XYZ from "ol/source/XYZ";
import Tile from "ol/layer/Tile";
import { tianditu } from "@/config/config.js";

const tiandituUrl = tianditu;

export const tiandituVecLayer = {
  vec_w: new Tile({
    pId: "tiandituVecLayer",
    source: new XYZ({
      url: tiandituUrl.vec_w,
      crossOrigin: "anonymous",
    }),
    visible: true,
  } as any),
  cva_w: new Tile({
    pId: "tiandituVecLayer",
    source: new XYZ({
      url: tiandituUrl.cva_w,
      crossOrigin: "anonymous",
    }),
    visible: true,
  } as any),
};

export const tiandituImgLayer = {
  img_w: new Tile({
    pId: "tiandituImgLayer",
    source: new XYZ({
      url: tiandituUrl.img_w,
      crossOrigin: "anonymous",
    }),
    visible: false,
  } as any),
  cia_w: new Tile({
    pId: "tiandituImgLayer",
    source: new XYZ({
      url: tiandituUrl.cia_w,
      crossOrigin: "anonymous",
    }),
    visible: false,
  } as any),
};

export const tiandituCesuimLayer = {
  cesuim_layer: new Tile({
    pId: "tiandituCesuimLayer",
    source: new XYZ({
      url: tiandituUrl.cesuim_layer,
      crossOrigin: "anonymous",
    }),
    visible: false,
  } as any),
  cesuim_name: new Tile({
    pId: "tiandituCesuimLayer",
    source: new XYZ({
      url: tiandituUrl.cesuim_name,
      crossOrigin: "anonymous",
    }),
    visible: false,
  } as any),
};
